---
id: 5dc24165f86c76b9248c6ebc
title: Hatua ya 9
challengeType: 0
dashedName: step-9
---

# --description--

Vipengele vyote vya `img` vinapaswa kuwa na sifa ya `alt`. Maandishi ya sifa ya `alt` hutumika kwa visoma skrini ili kuboresha ufikivu na huonyeshwa picha ikishindwa kupakiwa.

Here is an example of an `img` element with an `alt` attribute:

```html
<img src="cat.jpg" alt="A cat">
```

Ndani ya kipengele cha `img`, ongeza sifa ya `alt` yenye maandishi haya:

`A cute orange cat lying on its back`

# --hints--

Msimbo wako unapaswa kuwa na kipengele cha `img`. Uliondoa kipengele cha `img` kutoka hatua ya awali.

```js
assert(document.querySelector('img'));
```

Kipengele chako cha `img` hakina sifa ya `alt`. Hakikisha kuwa kuna nafasi baada ya jina la tagi inayofungua na/au kuna nafasi kabla ya majina yote ya sifa.

```js
assert(document.querySelector('img').hasAttribute('alt'));
```

Thamani ya sifa ya kipengele cha `img` ya `alt` imewekwa kuwa kitu kingine isipokuwa 'A cute orange cat lying on its back'. Hakikisha kuwa thamani ya sifa ya `alt` imezungukwa na alama za nukuu.

```js
const altText = document
  .querySelector('img')
  .alt.toLowerCase()
  .replace(/\s+/g, ' ');
assert(altText.match(/A cute orange cat lying on its back\.?$/i));
```

# --seed--

## --seed-contents--

```html
<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>See more cat photos in our gallery.</p>
--fcc-editable-region--
      <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg">
--fcc-editable-region--
    </main>
  </body>
</html>
```

